﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.Web.UI.Controls;
using ZX.TR.Library;
using ZX.TR.Bussiness;
namespace ZX.WebApp.EditWidows
{
    public partial class SubjectList : ListPage
    {
        BTrQuestionnaireSubject bt = new BTrQuestionnaireSubject();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.EntityName == "V_TrQuestionnaireSubject")
            {
                QuestinnaireId = this.Request.QueryString["id"];
                SubjectItems = this.Request.QueryString["its"];

                IList<TrQuestionnaireSubject> list = bt.GetQuestionnaireSubjectInfoByQuestionnaireId(new Guid(QuestinnaireId));
                if (list == null)
                {
                    AllItems = 0;
                }
                else
                {
                    AllItems = list.Count;
                }
            }
        }

        private string questinnaireId;
        /// <summary>
        /// 问卷ID
        /// </summary>
        public string QuestinnaireId
        {
            get { return this.Request.QueryString["id"]; }
            set { this.questinnaireId = value; }
        }

        private string subjectItems = "";
        /// <summary>
        /// 预设的问卷题目数量
        /// </summary>
        public string SubjectItems
        {
            get { return this.Request.QueryString["its"]; }
            set { this.subjectItems = value; }
        }

        /// <summary>
        /// 实际的问卷题目数量
        /// </summary>
        public int AllItems
        {
            get;
            set;
        }    

        /// <summary>
        /// 页面抬头
        /// </summary>
        public string PageTitles
        {
            get { return this.GetStringFromQueryString("title", ""); }
        }

        public string DutyId
        {
            get { return this.GetStringFromQueryString("id", ""); }
        }

        public string CustomerName
        {
            get { return this.GetStringFromQueryString("cn", ""); }
        }

        public string ShowCustomerType
        {
            get { return this.GetStringFromQueryString("ct", ""); }
        }
    }
}